LiveBasisCurve
var = vol^2 = skewMult * skewFN[ xMult * (xAxis - xShift) ]
METADATA
Attribute | Value |
---|---|
Topic | 1000-analytics |
MLink Token | SRMLinkAnalytics |
Product | SRAnalytics |
accessType | SELECT |
Table Definition
Field | Type | Key | Default Value | Comment |
---|---|---|---|---|
ekey_at | enum - AssetType | PRI | 'None' | |
ekey_ts | enum - TickerSrc | PRI | 'None' | |
ekey_tk | VARCHAR(12) | PRI | '' | |
ekey_yr | SMALLINT UNSIGNED | PRI | 0 | |
ekey_mn | TINYINT UNSIGNED | PRI | 0 | |
ekey_dy | TINYINT UNSIGNED | PRI | 0 | |
surfaceType | enum - SurfaceCurveType | PRI | 'None' | |
minX | DOUBLE | 0 | for x in minX maxX y spline for x minX y leftA leftB x for x maxX y rightA rightB x | |
maxX | DOUBLE | 0 | ||
leftA | DOUBLE | 0 | ||
leftB | DOUBLE | 0 | ||
rightA | DOUBLE | 0 | ||
rightB | DOUBLE | 0 | ||
numPoints | INT | 0 | number of points used in basisFN fit | |
numExpiries | INT | 0 | number of underlierexpiries used in basisFN fit | |
fitMAE | DOUBLE | 0 | final basisFN fit mean abs error | |
timestamp | DATETIME(6) | '1900-01-01 00:00:00.000000' | ||
PointList | JSON | 'JSON_OBJECT()' |
PRIMARY KEY DEFINITION (Unique)
Field | Sequence |
---|---|
ekey_tk | 1 |
ekey_yr | 2 |
ekey_mn | 3 |
ekey_dy | 4 |
ekey_at | 5 |
ekey_ts | 6 |
surfaceType | 7 |
JSON Block (PointList)
Field | Type | Comment |
---|---|---|
x | double | skew x axis |
y | double | skew fn value usually y10 x00 |
CREATE TABLE EXAMPLE QUERY
CREATE TABLE `SRAnalytics`.`MsgLiveBasisCurve` (
`ekey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None',
`ekey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None',
`ekey_tk` VARCHAR(12) NOT NULL DEFAULT '',
`ekey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0,
`ekey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`ekey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`surfaceType` ENUM('None','Live','PrevDay','Interp','Close','Test') NOT NULL DEFAULT 'None',
`minX` DOUBLE NOT NULL DEFAULT 0 COMMENT 'for x in (minX, maxX) y = spline(.); for x < minX: y = leftA + leftB * x; for x > maxX: y = rightA + rightB * x;',
`maxX` DOUBLE NOT NULL DEFAULT 0,
`leftA` DOUBLE NOT NULL DEFAULT 0,
`leftB` DOUBLE NOT NULL DEFAULT 0,
`rightA` DOUBLE NOT NULL DEFAULT 0,
`rightB` DOUBLE NOT NULL DEFAULT 0,
`numPoints` INT NOT NULL DEFAULT 0 COMMENT 'number of points used in basisFN fit',
`numExpiries` INT NOT NULL DEFAULT 0 COMMENT 'number of underlier/expiries used in basisFN fit',
`fitMAE` DOUBLE NOT NULL DEFAULT 0 COMMENT 'final basisFN fit mean abs error',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000',
`PointList` JSON NOT NULL DEFAULT JSON_OBJECT() CHECK(JSON_VALID(PointList)),
PRIMARY KEY USING HASH (`ekey_tk`,`ekey_yr`,`ekey_mn`,`ekey_dy`,`ekey_at`,`ekey_ts`,`surfaceType`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='var = vol^2 = skewMult * skewFN[ xMult * (xAxis - xShift) ]';
SELECT TABLE EXAMPLE QUERY
SELECT
`ekey_at`,
`ekey_ts`,
`ekey_tk`,
`ekey_yr`,
`ekey_mn`,
`ekey_dy`,
`surfaceType`,
`minX`,
`maxX`,
`leftA`,
`leftB`,
`rightA`,
`rightB`,
`numPoints`,
`numExpiries`,
`fitMAE`,
`timestamp`,
`PointList`
FROM `SRAnalytics`.`MsgLiveBasisCurve`
WHERE
/* Replace with a ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') */
`ekey_at` = 'None'
AND
/* Replace with a ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') */
`ekey_ts` = 'None'
AND
/* Replace with a VARCHAR(12) */
`ekey_tk` = 'Example_ekey_tk'
AND
/* Replace with a SMALLINT UNSIGNED */
`ekey_yr` = 123
AND
/* Replace with a TINYINT UNSIGNED */
`ekey_mn` = 1
AND
/* Replace with a TINYINT UNSIGNED */
`ekey_dy` = 1
AND
/* Replace with a ENUM('None','Live','PrevDay','Interp','Close','Test') */
`surfaceType` = 'None';
Doc Columns Query
SELECT * FROM SRAnalytics.doccolumns WHERE TABLE_NAME='LiveBasisCurve' ORDER BY ordinal_position ASC;